import java.util.*;
/**
 * @author LKQ
 * @date 2022/2/26 11:09
 * @description 无法
 */
public class Solution2 {
    public static void main(String[] args) {

    }
    public int[] corpFlightBookings(int[][] bookings, int n) {
        Map<Integer, Integer> map = new HashMap<>();
        for (int[] booking : bookings) {
            int left = booking[0], right= booking[1];
            while (left <= right) {
                map.put(left, map.getOrDefault(left, 0) + booking[2]);
                left++;
            }
        }
        int[] ans = new int[n];
        for (int i = 0; i < n; i++) {
            ans[i] = map.getOrDefault(i, 0);
        }
        return ans;
    }
}
